package cn.bjsxt.oop;

public class Point {
	double x, y, z;
	
	public Point(double _x, double _y, double _z){
		x = _x;
		y = _y;
		z = _z;
	}
	
	public void SetX(double _x) {
		x = _x;
	}
	
	public void SetY(double _y) {
		y = _y;
	}
	
	public void SetZ(double _z) {
		z = _z;
	}
	
	public double distance(Point p) {
		double result = Math.sqrt((x-p.x)*(x-p.x) + (y - p.y)*(y - p.y) + (z - p.z) * (z - p.z));
		return result;
	}
	
	public static void main(String[] args){
		Point p = new Point(3, 4, 8);
		p.SetX(10);
		p.SetY(6);
		p.SetZ(2);
		Point p2 = new Point(200, 40, 80);
		System.out.println(p.x+ " " + p.y + " " +  p.z);
		System.out.println(p.distance(p2));
	}
}
